﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;

namespace LingYue_PictureProcessCenter.Core.HardwareInfo
{
    public class HardwareInfo
    {
        public HardwareInfo()
        {
            HardwareInfoList = new List<Dictionary<string, string>>();
            ManagementClass Searcher = new ManagementClass("Win32_VideoController");
            foreach (ManagementObject Obj in Searcher.GetInstances())
            {
                HardwareInfoList.Add(new Dictionary<string, string>());
                foreach (PropertyData Pdata in Obj.Properties)
                {
                    if (Obj[Pdata.Name] != null && Obj[Pdata.Name].ToString() != "")
                    {
                        Dictionary<String, String> LastInfo = HardwareInfoList.Last();
                        LastInfo.Add(Pdata.Name, Obj[Pdata.Name!].ToString()!);
                    }
                }
            }
        }

        public List<Dictionary<String, String>> HardwareInfoList { set; get; }
    }
}